#ifndef HBBOARD_H
#define HBBOARD_H

#include "PublicDefine.h"
#include <QPainter>
#include <QPoint>
#include <QWidget>

class HBBoard : public QWidget {
    Q_OBJECT
public:
    explicit HBBoard(QWidget* parent = nullptr);

    void configPoints(QList<HBPoint> points);

    // QWidget interface
protected:
    void paintEvent(QPaintEvent* event);

private:
    QList<HBPoint> m_points;
    QVector<QPoint> m_toPoints;

    qreal m_minX = 0;
    qreal m_minY = 0;
    qreal m_maxX = 0;
    qreal m_maxY = 0;

private:
    void m_dealData();
    QPoint m_point(HBPoint p);

    void m_drawX(QPainter& painter);
    void m_drawY(QPainter& painter);
};

#endif // HBBOARD_H
